package com.zz.parkingsystem.controller.inspector;

import com.zz.parkingsystem.entity.Order;
import com.zz.parkingsystem.service.OrderService;
import com.zz.parkingsystem.util.Result;
import com.zz.parkingsystem.util.ResultGenerator;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author ：zzz
 * @date ：Created in 2022/9/11 15:44
 * @description：aaa
 */
@RestController
@AllArgsConstructor
@RequestMapping("ins/Orde")
@Slf4j
public class OrderController {
    private OrderService orderService;
    //根据订单项id进行查订单表的信息，再进行修改
    @PostMapping("/selectOiid/{id}")
    public Result selectOiid(Long id){
        Order order = orderService.selectOiid(id);
        order.setPtId(1);
        order.setOrderStatus(2);
        order.setPayingTime(new Date());
        orderService.updateByPrimaryKeySelective(order);
        return ResultGenerator.genSuccessResult("修改成功");
    }


}
